/* 全局样式和深色模式变量 */

/* CSS 变量定义 */
:root {
  /* 浅色模式变量 */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-border: #e5e7eb;
  --color-shadow: rgba(0, 0, 0, 0.1);

  /* 🔥 新增：语义化颜色 */
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  --color-error: #ef4444;
  --color-error-light: #fee2e2;
  --color-info: #06b6d4;
  --color-info-light: #cffafe;

  /* 🔥 新增：中性色阶 */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* 🔥 新增：品牌色渐变 */
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-error: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.dark {
  /* 深色模式变量 */
  --color-bg-primary: #1e293b;
  --color-bg-secondary: #0f172a;
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-border: #334155;
  --color-shadow: rgba(0, 0, 0, 0.3);

  /* 🔥 深色模式语义化颜色 */
  --color-success: #22c55e;
  --color-success-light: #064e3b;
  --color-warning: #fbbf24;
  --color-warning-light: #78350f;
  --color-error: #f87171;
  --color-error-light: #7f1d1d;
  --color-info: #22d3ee;
  --color-info-light: #164e63;
}

/* 基础样式 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

/* 🔥 Typography 系统 */
.text-display {
  font-size: 3rem;       /* 48px - 大标题 */
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-heading {
  font-size: 2rem;       /* 32px - 页面标题 */
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.text-title {
  font-size: 1.25rem;    /* 20px - 卡片标题 */
  font-weight: 600;
  line-height: 1.4;
}

.text-body {
  font-size: 1rem;       /* 16px - 正文 */
  font-weight: 400;
  line-height: 1.5;
}

.text-caption {
  font-size: 0.875rem;   /* 14px - 辅助文字 */
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.text-small {
  font-size: 0.75rem;    /* 12px - 最小文字 */
  color: var(--color-text-secondary);
  line-height: 1.33;
}

/* 🔥 间距系统 (8px Grid) */
.spacing-1 { padding: 0.5rem; }   /* 8px */
.spacing-2 { padding: 1rem; }     /* 16px */
.spacing-3 { padding: 1.5rem; }   /* 24px */
.spacing-4 { padding: 2rem; }     /* 32px */
.spacing-5 { padding: 3rem; }     /* 48px */
.spacing-6 { padding: 4rem; }     /* 64px */

/* 自定义工具类 */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-effect {
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid rgba(51, 65, 85, 0.3);
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-success-text {
  background: var(--gradient-success);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-glow {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.dark .shadow-glow {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
  }
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* 🔥 Tab栏相关样式 */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* 添加第三层背景色 */
:root {
  --color-bg-tertiary: #f3f4f6;
}

.dark {
  --color-bg-tertiary: #1e293b;
}

/* 🔥 Ant Design 组件样式覆盖 - 统一字体大小 */

/* Table 组件 */
.ant-table {
  font-size: 14px; /* 保持与系统 text-sm 一致 */
}

.ant-table-thead > tr > th {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-gray-700);
  background-color: var(--color-gray-50);
}

.dark .ant-table-thead > tr > th {
  color: var(--color-gray-300);
  background-color: var(--color-gray-800);
}

.ant-table-tbody > tr > td {
  font-size: 14px;
  color: var(--color-gray-900);
}

.dark .ant-table-tbody > tr > td {
  color: var(--color-gray-100);
}

/* Button 组件 */
.ant-btn {
  font-size: 14px;
}

.ant-btn-lg {
  font-size: 16px;
}

.ant-btn-sm {
  font-size: 12px;
}

/* Modal 组件 */
.ant-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-gray-900);
}

.dark .ant-modal-title {
  color: var(--color-gray-100);
}

.ant-modal-content {
  background-color: var(--color-bg-primary);
}

.dark .ant-modal-content {
  background-color: var(--color-gray-800);
}

/* Form 组件 */
.ant-form-item-label > label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-gray-700);
}

.dark .ant-form-item-label > label {
  color: var(--color-gray-300);
}

.ant-input,
.ant-input-password,
.ant-select-selector {
  font-size: 14px;
}

/* Tag 组件 */
.ant-tag {
  font-size: 12px;
}

/* Pagination 组件 */
.ant-pagination {
  font-size: 14px;
}

/* Message 组件 */
.ant-message-notice-content {
  font-size: 14px;
}

/* Popconfirm 组件 */
.ant-popconfirm-message-title {
  font-size: 14px;
}

.ant-popconfirm-description {
  font-size: 14px;
}

/* 🔥 用户管理表格特定样式 */
.user-management-table .ant-table-thead > tr > th {
  background-color: #f9fafb;
  font-weight: 600;
  padding: 16px;
  border-bottom: 2px solid #e5e7eb;
}

.dark .user-management-table .ant-table-thead > tr > th {
  background-color: #1f2937;
  border-bottom-color: #374151;
}

.user-management-table .ant-table-tbody > tr > td {
  padding: 16px;
  vertical-align: middle;
}

.user-management-table .ant-table-tbody > tr:hover > td {
  background-color: #f3f4f6;
}

.dark .user-management-table .ant-table-tbody > tr:hover > td {
  background-color: #374151;
}

.user-management-table .ant-table-tbody > tr {
  transition: all 0.2s ease;
}

/* Table 边框优化 */
.user-management-table .ant-table {
  border-radius: 0;
}

.user-management-table .ant-table-container {
  border-radius: 0;
}